Scenario #1020: Add Representative To Partner

UseCase Add Representative To Partner => Representative: Tracy Trust for Test AG

Given Properties

name value
partnerPersonTradeName Test AG
representativeFamilyName Trust
representativeGivenName Tracy
representativePostalAddress “name”: “Michelle Matthieu”,
“street”: “An der Alster 100”,
“zipcode”: “20000”,
“city”: “Hamburg”,
“country”: “Germany”
representativePhoneNumber +49 40 123456
representativeEMailAddress tracy.trust@example.org

Person: Test AG

GET /api/hs/office/persons?name=Test+AG
=> status: 200 OK 
[ {
  "uuid" : "f8f6ad7e-53d2-4cf0-9cb9-30ca2767c599", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Tracy Trust

POST /api/hs/office/persons
{
  "personType" : "NATURAL_PERSON",
  "familyName" : "Trust",
  "givenName" : "Tracy"
}
=> status: 201 CREATED 26658811-aa68-47da-bd39-255e5285b590

Please check first if that person already exists, if so, use it’s UUID below.

HINT: A representative is always a natural person and represents a non-natural-person.

Contact: Tracy Trust

POST /api/hs/office/contacts
{
  "caption" : "Tracy Trust",
  "postalAddress" : {
    "name" : "Michelle Matthieu",
    "street" : "An der Alster 100",
    "zipcode" : "20000",
    "city" : "Hamburg",
    "country" : "Germany"
  },
  "phoneNumbers" : {
    "main" : "+49 40 123456"
  },
  "emailAddresses" : {
    "main" : "tracy.trust@example.org"
  }
}
=> status: 201 CREATED 15ef480a-aa7f-41a9-8545-c28fc7c5f1dc

Please check first if that contact already exists, if so, use it’s UUID below.

Create Representative: Tracy Trust for Test AG

POST /api/hs/office/relations
{
  "type" : "REPRESENTATIVE",
  "anchor.uuid" : "f8f6ad7e-53d2-4cf0-9cb9-30ca2767c599", // Person: Test AG
  "holder.uuid" : "26658811-aa68-47da-bd39-255e5285b590", // Person: Tracy Trust
  "contact.uuid" : "15ef480a-aa7f-41a9-8545-c28fc7c5f1dc" // Contact: Tracy Trust
}
=> status: 201 CREATED 1a39a339-4b19-40b2-8ba3-eece0881c001

Verify the REPRESENTATIVE Relation Got Removed

GET /api/hs/office/relations?relationType=REPRESENTATIVE&personData=Trust
=> status: 200 OK 
[ {
  "uuid" : "1a39a339-4b19-40b2-8ba3-eece0881c001",
  "anchor" : {
    "uuid" : "f8f6ad7e-53d2-4cf0-9cb9-30ca2767c599", // Person: Test AG
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Test AG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "holder" : {
    "uuid" : "26658811-aa68-47da-bd39-255e5285b590", // Person: Tracy Trust
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Tracy",
    "familyName" : "Trust"
  },
  "type" : "REPRESENTATIVE",
  "mark" : null,
  "contact" : {
    "uuid" : "15ef480a-aa7f-41a9-8545-c28fc7c5f1dc", // Contact: Tracy Trust
    "caption" : "Tracy Trust",
    "postalAddress" : {
      "city" : "Hamburg",
      "name" : "Michelle Matthieu",
      "street" : "An der Alster 100",
      "country" : "Germany",
      "zipcode" : "20000"
    },
    "emailAddresses" : {
      "main" : "tracy.trust@example.org"
    },
    "phoneNumbers" : {
      "main" : "+49 40 123456"
    }
  }
} ]

generated on 03-10-2025 12:07:38 for branch master